package com.eightworld3.supermarket.config;

import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.OpenAPI;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author EightWorld3
 */
@Configuration
public class SwaggerConfig {

private License license() {
    return new License()
            .name("MIT")
            .url("https://opensource.org/licenses/MIT");
}

    private Info info(){
        return new Info()
                .title("API")
                .description("A test project")
                .version("v1.0.0")
                .license(license());
    }

    @Bean
    public OpenAPI api() {
        return new OpenAPI()
                .info(info());
    }
}

